package com.apes.autoparts.parts.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * @Title: JsRequestLogging
 * @Author fj
 * @Package com.apes.autoparts.parts.model
 * @Date 2023/6/27 15:11
 * @description: 精时调用兆配日志实体类
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = JsRequestLogging.CONST_TABLE_NAME)
public class JsRequestLogging {

    public static final String CONST_TABLE_NAME = "js_request_loging";

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Comment("唯一码")
    private Integer id;

    @Column(name="begin_time")
    @Comment("开始时间")
    private Date beginTime;

    @Column(name="end_time")
    @Comment("结束时间")
    private Date endTime;

    @Column(name="name")
    @Comment("方法名")
    String name;

    @Column(name="request" ,length = 4000)
    @Comment("请求内容")
    String request;

    @Column(name="response", columnDefinition = "CLOB")
    @Comment("返回内容")
    String response;

    @Column(name="time")
    @Comment("耗时(毫秒)")
    private long time; //耗时(毫秒)


}
